#include <iostream>
#include <string>
using namespace std;

//类模版成员函数 类外实现
template<class T1, class T2>
class Person
{
public:
    T1 name;
    T2 age;

    Person(T1 name, T2 age);
    void show();
};

//构造函数的类外实现
template<class T1,class T2>
Person<T1,T2>::Person(T1 name, T2 age)
{
    this->name = name;
    this->age = age;
}

//成员函数的类外实现
template<class T1, class T2>
void Person<T1, T2>::show()
{
    cout << "姓名：" << this->name << endl;
    cout << "年龄：" << this->age << endl;
}


void test1()
{
    Person<string, int> p("孙悟空", 999);
    p.show();
}

int main()
{
    test1();
    return 0;
}